package com.tfj.mvp.tfj.live.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.hyphenate.tfj.R;
import com.tfj.mvp.tfj.live.bean.LiveBean;

import java.util.List;

import androidx.recyclerview.widget.RecyclerView;

public class LiveAdapter extends RecyclerView.Adapter<LiveAdapter.BeautyViewHolder> {
    /**
     * 上下文
     */
    private Context mContext;
    /**
     * 数据集合
     */
    private List<LiveBean> data;

    public LiveAdapter(List<LiveBean> data, Context context) {
        this.data = data;
        this.mContext = context;
    }

    @Override
    public BeautyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        //加载item 布局文件
        View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_live, parent, false);
        return new BeautyViewHolder(view);
    }

    @Override
    public void onBindViewHolder(BeautyViewHolder holder, int position) {
        //将数据设置到item上
    }

    @Override
    public int getItemCount() {
        return data.size();
    }

    static class BeautyViewHolder extends RecyclerView.ViewHolder {

        public BeautyViewHolder(View itemView) {
            super(itemView);
        }
    }
}
